import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

public class FileUpdater {
    public static final String  conputerPath = "C:/Users/ankeh/Documents/My Games/Octopath_Traveler/76561199071731213/SaveGames";
    public static final String tempPath = "C:/Users/ankeh/Documents/My Games/Octopath_Traveler/76561199071731213/SaveGames/010057D006492000";
    public static final String androidPath = "/storage/emulated/0/Android/data/com.antutu.ABenchMark/files/nand/user/save/0000000000000000/F9AC6A7936132953AAF3FF7E71E795FE/010057D006492000";
    public static final String deviceID = "6e5dd5e5";
    public static void main(String[] args) throws InterruptedException {
        List<LocalDateTime>  dateList = new ArrayList<>();
        List<String>  fileANames = new ArrayList<>();
        fileANames.add("SaveData0.sav");
        fileANames.add("SaveData1.sav");
        fileANames.add("SystemData.sav");
        List<String>  fileBNames = new ArrayList<>();
        fileBNames.add("KSSaveData0");
        fileBNames.add("KSSaveData1");
        fileBNames.add("KSSystemData");
        for (String fielName:fileBNames){
            String ksSaveDataDate = AdbOperator.getFileUpdateTime(androidPath, fielName, deviceID);
            LocalDateTime ksSaveDataTime = Utils.strToDateTime(ksSaveDataDate);
            dateList.add(ksSaveDataTime);
        }
        AdbOperator.pull(androidPath,conputerPath,deviceID);
        Utils.updateFile(conputerPath,tempPath,fileANames,fileBNames,dateList);
        AdbOperator.push(tempPath,androidPath,deviceID);
        Utils.deleteByPath(FileUpdater.tempPath);
    }
}
